xxxxxxxxxx file: (name, values) => callback(new Error('LoadStorageRecipient.file should not be called.')), (error, update) => { this._detect.detectStorageAsync( ukey, (error, load) => { callback(load.editedUTC === 2345 ? null : new Error('Incorrect editedUTC value ' + load.editedUTC + ' (expected 2345).')); }); }); }); }​ updateTwice_loadAgain_secondValue(callback: (error: Error) => void) { var ukey = this._generateKey(); this._detect.detectStorageAsync( ukey, (error, load) => { load.load({ files: () => { }, file: (name, values) => callback(new Error('LoadStorageRecipient.file should not be called.')), completed: (updater: teapo.storage.attached.UpdateStorage) => { updater.update( 'file.txt', 'property1', 'value2', (error: Error) => updater.update( 'file.txt', 'property1', 'value4', (error: Error) => { this._detect.detectStorageAsync( ukey, (error, load) => { var files: any = {}; load.load({ files: () => { }, file: (name, values) => files[name] = values, completed: (updater) => { var fileTxt = files['file.txt']; if (!fileTxt) { callback(new Error('File is not reported on subsequent load.')); } else { var propertyValue = fileTxt['property1']; callback(propertyValue === 'value4' ? null : new Error('Wrong value ' + propertyValue)); } }, failed: (error) => callback(error) }); }); })); }, failed: (error) => callback(error) }); }); }​ private _generateKey(): string { return Math.random() + '-' + Math.random(); }​ }​}